package com.fosu.web.controller.outdated;


/**
 * Desription
 * 商品信息详情页接口
 * @author manno
 * @date 2020/10/15
 */
/*
@RestController
@CrossOrigin
public class ProductDetailController
{
    @Autowired
    ProductDetailDao productDetailDao;
    @Autowired
    ProductImgDao productImgDao;
    @Autowired
    LabelDao labelDao;
    @Autowired
    ProductCategoriesDao productCategoriesDao;
    @Autowired
    CustomizeCategoriesDao customizeCategoriesDao;

    */
/**根据首页用户传入的商品id返回特定商品页面的信息(不包括商品评论信息)*//*

    @GetMapping("/getProductDetailById")
    public List<ProductDetail> getProductDetailById(@RequestParam int productId)
    {
        List<ProductDetail> products = productDetailDao.findProductDetailById(productId);
        for (ProductDetail p:products
        )
        {
            */
/**封装商品的标签组、图片组、类别组*//*

            p.setLabels(labelDao.findLabelByProductId(p.getProductId()));
            p.setProductImgs(productImgDao.findProductImgByProductId(p.getProductId()));
            ProductCategories categories = productCategoriesDao.findCategoriesByProductId(p.getProductId());
            List<CustomizeCategories> customizeCategories = customizeCategoriesDao.findCustomizeCategoriesById(categories.getCustomizeCategoriesId());
            */
/**拼接自定义类别字串*//*

            if(customizeCategories.size() != 0)
            {
                List<String> customizeCategoriesList = new ArrayList<>();
                for (CustomizeCategories c : customizeCategories)
                {
                    customizeCategoriesList.add(new String(c.getCategory()));
                }
                */
/**自定义类别字串封装到类别组中*//*

                categories.setCustomizeCategories(customizeCategoriesList);
            }
            */
/**封装自定义类别字串到商品信息中*//*

            p.setProductCategories(categories);
        }
        return products;
    }
}
*/

